from pathlib import Path

pic_dir = Path(r"F:\手机备份\DCIM\Camera")

count = 0
for pic in pic_dir.glob("*.jpg"):
    stem = pic.stem
    comp = stem + "_comps.jpg"
    if Path(pic_dir / comp).exists():
        count += 1
        print(comp)
        Path(pic_dir / comp).unlink()
print('计数', count)
